import request from '@/utils/request'

export function getPermissionList(params) {
  return request({
    url: '/permissions',
    params
  })
}

export function getPermissionCount() {
  return request({
    url: '/permissions/count'
  })
}

export function getDetailPermission(id) {
  return request({
    url: `/permissions/${id}`
  })
}

export function addPermission(data) {
  return request({
    url: `/permissions`,
    method: 'post',
    data
  })
}

export function editePermission(data) {
  return request({
    url: `/permissions/${data.id}`,
    method: 'put',
    data
  })
}

export function delPermission(id) {
  return request({
    url: `/permissions/${id}`,
    method: 'delete'
  })
}
